<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>发现</title>
    <link rel="stylesheet" type="text/css" href="../../css/api.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/common.css" />
    <link rel="stylesheet" type="text/css" href="../../css/aui.css" />
    <link rel="stylesheet" type="text/css" href="../../css/aui-pull-refresh.css" />
    <link rel="stylesheet" type="text/css" href="../../css/swiper.min.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style.css"/>
</head>

<style>
  .aui-bar.aui-bar-light.share_nav{
    background:#fff;
    padding-top:2.5rem;
    position: fixed;
    margin-top: 0 !important;
  }
  .share_nav .share_nav_title{
    height: 4.4rem;
    line-height: 4.4rem;
    position: relative;
    top: 0;
    left: 0;
    right: 0;
    font-size:1.6rem;
    color:#000;
  }
  .share_nav .share_nav_left{
    top: 2.5rem;
    left: 1.3rem;
    position: absolute;
    z-index:10;
  }
  .share_nav .share_nav_right{
    top: 2.5rem;
    right: 1.3rem;
    position: absolute;
    z-index:10;
  }
  .share_nav .share_nav_right span{
    position: absolute;
    top:0.8rem;
    right:0;
    width:1.2rem;
    height:1.2rem;
    line-height: 1.2rem;
    color:#fff;
    background:#ed6a20;
    font-size:1rem;
    border-radius: 100%;
  }
  .share_nav img{
    height:1.7rem;
    margin-top:1.35rem;
  }

  .spacing10 {
    width: 100%;
    height: 1rem;
    background: #f5f5f5;
  }
  .main_class {
    padding:0 1.3rem;
  }
  .main_class > ul {
    padding: 0;
    margin: 0;
    padding:2rem 0;
    background:#fff;
    box-shadow: 0rem 0.1rem 0.95rem 0.05rem
  		rgba(184, 183, 183, 0.25);
  	border-radius: 0.7rem;
  }
  .main_class > ul > li {
    width: 33.33%;
    float: left;
    text-align: center;
  }
  .main_class > ul > li img{
    width:3.6rem;
    margin:0 auto;
  }
  .main_class > ul > li .main_class1{
    margin-top:1.55rem;
    border-right:0.05rem solid #e5e5e5;
  }
  .main_class > ul > li:last-child .main_class1{
    border-right:none;
  }
  .main_class > ul > li h5{
  	font-size: 1.39rem;
    line-height: 1;
  	font-weight: normal;
  	font-stretch: normal;
  	color: #000000;
    text-align: center;
  }
  .main_class > ul > li h6{
    font-size: 1.17rem;
  	font-weight: normal;
  	font-stretch: normal;
  	color: #333333;
    line-height: 1;
    margin-top:0.85rem;
    text-align: center;
  }

  .share_people table {
  	width: 100%;
  }
  .share_people table th {
  	color: #333;
  	border-bottom: 1px solid #e8e8e8;
  	font-size: 1.2rem;
  	font-weight: normal;
  	text-align: center;
  	line-height: 2.5rem;
  	letter-spacing: 1px;
    background:#f5f5f5;
  }
  .share_people table td {
  	font-size: 1.1rem;
  	color: #666;
  	letter-spacing: 0px;
  	line-height: 4.4rem;
  	text-align: center;
    border-bottom: 1px solid #efefef;
    border-right: 1px solid #efefef;
  }
  .share_people table tbody tr td:last-child{
    border-right:none;
  }
  .share_people table table {
  	box-shadow: 0 0.06px 0.24px hsla(214, 3%, 49%, .5);
  }
  .share_people table td span {
  	color: #ed6a20;
  	font-size: 1.2rem;
  }
  .share_people_sec2{
    padding:0 1.3rem;
  }
  .mag69{
    margin-top:6.9rem;
    background:#f5f5f5;
  }
  .share_people_sec2_list{
    background-color: #ffffff;
  	box-shadow: 0rem 0.1rem 0.95rem 0.05rem
  		rgba(184, 183, 183, 0.25);
  	border-radius: 0.7rem;
    overflow: hidden;
  }
  .share_people_sec2_list .share{
    padding:2rem 2.25rem;
  }
  .share_people_sec2_list .share h5{
    font-size:1.4rem;
    color:#000000;
    line-height: 1;
  }

  .share_commision{
    margin: 0;
    padding: 0 0 0 2.25rem;
    background: #fff;
    box-shadow: 0rem 0.1rem 0.95rem 0.05rem rgba(184, 183, 183, 0.25);
    border-radius: 0.7rem;
    position: relative;
  }
  .share_commision h5{
    padding:2rem 0;
    font-size:1.4rem;
    line-height: 1;
    color:#000000;
    border-bottom: 0.05rem solid #efefef;
  }
  .share_commision_list{
    padding:2rem 0;
    position: relative;
  }
  .share_commision_list h6{
    font-size:1.3rem;
    color:#333333;
    line-height: 1.5rem;
  }
  .share_commision_list h6 span.kejie{
    font-size:1.5rem;
    color:#ed6a20;
    line-height: 1;
  }
  .share_commision_list h6 span.yijie{
    font-size:1.5rem;
    color:#999999;
    line-height: 1;
  }
  .share_commision_tixian{
    position: absolute;
    top:2.9rem;
    right:0.7rem;
    width: 6.8rem;
  	height: 2.4rem;
  	background-color: #ed6a20;
  	border-radius: 1.2rem;
    line-height: 2.4rem;
    font-size:1.3rem;
    color:#fff;
    text-align: center;
  }

</style>
<body>
<div id="app">
  <header class="aui-bar aui-bar-nav aui-bar-light share_nav">
    <a class="aui-pull-left share_nav_left" onclick="close_win()">
      <img src="../../image/share/share_index_nav4.png" alt="">
    </a>
    <div class="aui-title share_nav_title">总佣金</div>
    <a class="aui-pull-right share_nav_right">
      <img src="../../image/share/share_index_nav3.png" alt="">
      <span>5</span>
    </a>
  </header>
  <!--  / warpper  -->
  <div class="warpper pad69 aui-refresh-content">
    <div class="spacing10"></div>

    <div class="main_class">
      <ul class="clearfix">
       <li onclick="goSharePeople()">
          <img src="../../image/share/share_index_sec1_1.png">
          <div class="main_class1">
            <h5>{{ share_person }}</h5>
            <h6>分享人数(人)</h6>
          </div>
        </li>
        <li onclick="goShareShop()">
          <img src="../../image/share/share_index_sec1_2.png">
          <div class="main_class1">
            <h5>{{ discount }}</h5>
            <h6>分享商品(笔)</h6>
          </div>
        </li>
        <li onclick="goShareCommission()">
          <img src="../../image/share/share_index_sec1_3.png">
          <div class="main_class1">
            <h5>{{ share_money }}</h5>
            <h6>总佣金(元)</h6>
          </div>
        </li>
      </ul>
    </div>

    <div class="spacing10"></div>

    <div class="main_class">
      <div class="share_commision">
        <h5>我的佣金</h5>
        <div class="share_commision_list">
          <h6>可结佣金：<span class="kejie">¥{{ invite_money }}</span></h6>
          <h6 style="margin-top:1.65rem;">已结佣金：<span class="yijie">¥{{ set_money }}</span></h6>
          <div class="share_commision_tixian" onclick="goShareTixian()">立即提现</div>
        </div>
      </div>
    </div>

    <div class="spacing10"></div>

    <div class="share_people_sec2">
      <div class="share_people_sec2_list">
        <div class="share">
          <h5 style="margin-bottom:0;">佣金明细</h5>
        </div>
        <div class="share_people">
            <table style="top: 0px; opacity: 1;">
              <tbody>
                <tr>
                  <th style="width:24%;">类型</th>
                  <th style="width:36%;">分享时间</th>
                  <th style="width:20%;">所得佣金</th>
                </tr>
                <tr v-for="sharePrice in sharePriceList">
                  <td>{{ sharePrice.type }}</td>
                  <td>{{ sharePrice.add_time }}</td>
                  <td><span>¥{{ sharePrice.money }}</span></td>
                </tr>
              </tbody>
            </table>
        </div>
      </div>
    </div>

  </div>
  <!--  / warpper  -->
</div>
</body>
</html>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/zepto.js"></script>
<script type="text/javascript" src="../../script/vue.min.js"></script>
<script type="text/javascript" src="../../script/swiper.min.js"></script>
<script type="text/javascript" src="../../script/utils.js"></script>
<script type="text/javascript" src="../../script/common.js"></script>
<script type="text/javascript" src="../../script/aui-tab.js"></script>
<script type="text/javascript" src="../../script/aui-scroll.js"></script>
<script type="text/javascript" src="../../script/aui-pull-refresh.js"></script>
<script type="text/javascript" src="../../script/axios.min.js"></script>
<script type="text/javascript" src="../../script/axios-config.js"></script>

<script type="text/javascript">

  apiready = function(){
    setRefresh()
  }

  var vue = new Vue({
      el: '#app',
      data: {
          sharePriceList: [],
          share_person: 0,  //分享人数
          share_money: 0.00,  //分享佣金
          discount: 0,  //分享商品笔数
          invite_money: 0.00,
          set_money: 0.00,
      },
      mounted() {},
      created: function() {
          this.getPriceInfo();
      },
      computed: {
      },
      methods: {
          //获取列表
          getPriceInfo: function() {
              var $_this = this;
              const data = {
                  token: $api.getStorage('token'),
                  page:1,
                  list_rows:50
              }
              console.log(JSON.stringify(data));
              Axios.post(window.Url.share_price_list, data).then(function(res) {
                  console.log(JSON.stringify(res))
                  if (res.status == 1) {
                    $_this.sharePriceList = res.list;
                    $_this.share_money = res.share_money;
                    $_this.discount = res.discount;
                    $_this.share_person =  res.share_person
                    $_this.invite_money = res.invite_money;
                    $_this.set_money = res.set_money;
                  } else {
                      $_this.sharePriceList = {};
                      api.toast({
                          msg: '暂无明细',
                          duration: 2000,
                          location: 'bottom'
                      });
                  }
              }).catch((err) => {
                  $_this.sharePriceList = {}
                  api.alert({
                      msg: JSON.stringify(err.info)
                  });
              })
          },

      }
  })


  //刷新
  function setRefresh(){
      var pullRefresh = new auiPullToRefresh({
          container: document.querySelector('.aui-refresh-content'),
          triggerDistance: 100
      }, function(ret) {

          if (ret.status == "success") {
              setTimeout(function() {
                  pullRefresh.cancelLoading(); //刷新成功后调用此方法隐藏
              }, 1500)
          }
      })
  }

  function close_win(){
    api.closeWin({});
  }

  function goShareTixian(){
    api.openWin({
        name: 'shareTixian',
        url: './share_tixian.html',
        pageParam: {
            test:''
        }
    });
  }

  function goSharePeople(){
    api.openWin({
        name: 'sharePeople',
        url: './share_people.html',
        pageParam: {
            test:''
        }
    });
  }
  function goShareShop(){
    api.openWin({
        name: 'shareShop',
        url: './share_shop.html',
        pageParam: {
            test:''
        }
    });
  }

  function goShareCommission(){
    api.openWin({
        name: 'shareCommission',
        url: './share_commision.html',
        pageParam: {
            test:''
        }
    });
  }


</script>
